package models;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author luong
 * this entity is mapped to the Occurrence table
 */
@Entity 
@Table (name="Occurence")
public class HibernateOccurence implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	@Column (name = "OCC_ID")
	private int occ_id;
	
	@ManyToOne(cascade = CascadeType.REFRESH)
	@JoinColumn (name = "ELEM_OCC", referencedColumnName = "WORD_ID")
	private HibernateWord motId;
	
	@ManyToOne(cascade = CascadeType.REFRESH)
	@JoinColumn (name = "CONTAINER_TAG_OCC", referencedColumnName = "TAG_ID")
	private HibernateTags paraId;
	
	@Column(name = "freq")
	private int freq;	
	
	@Column
	private float tf;
	
	@Column
	private float idf;
	
	public HibernateOccurence() {}

	public int getId() {
		return occ_id;
	}

	public void setId(int id) {
		this.occ_id = id;
	}

	public HibernateWord getMotId() {
		return motId;
	}

	public void setMotId(HibernateWord motId) {
		this.motId = motId;
	}

	public HibernateTags getParaId() {
		return paraId;
	}

	public void setParaId(HibernateTags paraId) {
		this.paraId = paraId;
	}

	public int getFreq() {
		return freq;
	}

	public void setFreq(int freq) {
		this.freq = freq;
	}

	public float getTf() {
		return tf;
	}

	public void setTf(float tf) {
		this.tf = tf;
	}

	public float getIdf() {
		return idf;
	}

	public void setIdf(float idf) {
		this.idf = idf;
	}
	
}
